package com.sxxm.qxgl.controller;


import com.sxxm.qxgl.dto.cx;
import com.sxxm.qxgl.entity.SysDept;
import com.sxxm.qxgl.entity.SysMenu;
import com.sxxm.qxgl.entity.SysUser;
import com.sxxm.qxgl.service.SysMenuService;
import com.sxxm.qxgl.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author qjw
 * @since 2021-09-14
 */
@RestController
@Api(value = "菜单", tags = "菜单")
@RequestMapping("/sys-menu")
public class SysMenuController {
    SysMenuService sysMenuService;

    public SysMenuController(SysMenuService sysMenuService) {
        this.sysMenuService = sysMenuService;
    }

    @ApiOperation("查询")
    @PostMapping("/cx")
    public Result cx(@RequestBody SysMenu sysRole) {
        return sysMenuService.cx(sysRole);
    }

    @ApiOperation("修改")
    @PostMapping("/ModifyThe")
    public Result ModifyThe(@RequestBody SysMenu sysUser) {
        return sysMenuService.ModifyThe(sysUser);
    }

    @ApiOperation("添加")
    @PostMapping("/Addition")
    public Result Addition(@RequestBody SysMenu sysUser) {
        return sysMenuService.Addition(sysUser);
    }

    @ApiOperation("删除")
    @PostMapping("/Delete")
    public Result Delete(@RequestBody SysMenu sysUser) {
        return sysMenuService.Delete(sysUser.getId());
    }

    @ApiOperation("状态")
    @PostMapping("/zt")
    public Result zt(@RequestBody SysDept sysUser) {
        return sysMenuService.zt(sysUser.getId());
    }

    @ApiOperation("状态")
    @PostMapping("/dt")
    public Result dt(@RequestBody SysDept sysUser) {
        return sysMenuService.dt(sysUser.getId());
    }

    @ApiOperation("通过角色查询菜单")
    @PostMapping("/cxx")
    public Result cd(@RequestBody SysMenu sysRole) {
        return sysMenuService.cx(sysRole);
    }
}

